package com.burpee.service;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.burpee.dao.MessageDao;
import com.burpee.ui.Message;

@Service(value="messageService")
public class MessageServiceImpl implements MessageService {

	@Autowired
	MessageDao messageDao;
	public List<Message> list(HashMap<String, String> listdata) {
		
		return messageDao.list(listdata);
	}

	public Message view(long messageNo) {
		
		return messageDao.view(messageNo);
	}

	public boolean add(Message message) {
		
		if(messageDao.add(message) > 0){
			return true;
		}
		else{

			return false;
		}
	}

	public boolean remove(Message message) {
		if(messageDao.remove(message) > 0){
			return true;
		}
		else{

			return false;
		}
	}
	
	public int countmessage(String memberId){
		return messageDao.countmessage(memberId);
	}

}
